#ifndef __RATIO_COEF_H
#define __RATIO_COEF_H
#include <stdint.h>
#include "function_interface.h"


#define RC_METHOD_TABLE \
    X_MACRO(RC_METHOD_0,  0) \
    X_MACRO(RC_METHOD_1,  1) \
    X_MACRO(RC_METHOD_2,  2) \
    X_MACRO(RC_METHOD_3,  3) \
    X_MACRO(RC_METHOD_4,  4) \
    X_MACRO(RC_METHOD_5,  5) \
    X_MACRO(RC_METHOD_6,  6) \
    X_MACRO(RC_METHOD_7,  7) \
    X_MACRO(RC_METHOD_8,  8) \
    X_MACRO(RC_METHOD_9,  9) \
    X_MACRO(RC_METHOD_10, 10) \
    X_MACRO(RC_METHOD_11, 11) \
    X_MACRO(RC_METHOD_12, 12) \
    X_MACRO(RC_METHOD_13, 13) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    RC_METHOD_TABLE
#undef X_MACRO  
} rcMethod_t;


typedef struct
{
    uint32_t idx;
    rcMethod_t mthd;
    funcInfRatioCoefType_t type;
} rcTableEntry_t;


typedef rcTableEntry_t rcTable_t;


#define RC_TABLE_ENTRY_INIT(index, method, rcType) \
{ \
    .idx   = (index), \
    .mthd  = (method), \
    .type  = (rcType), \
}


int RatioCoef_GetFpgaValue(uint32_t addr, float realValue, uint16_t *pFpgaValue);
int RatioCoef_GetRealValue(uint32_t addr, uint16_t fpgaValue, float *pRealValue);


#endif
